

//
//  DHSetandHelpTableViewCell.m
//  DHKuaiYi
//
//  Created by 韩旭 on 16/11/15.
//  Copyright © 2016年 30-陈辉华. All rights reserved.
//

#import "DHSetandHelpTableViewCell.h"
#import <Masonry.h>
@implementation DHSetandHelpTableViewCell

- (void)awakeFromNib {
    
    [super awakeFromNib];
    [self setupUI];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self=[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self setupUI];
    }
    return self;
}

/**
 初始化
 */
- (void)setupUI {
    
    UIImageView *icon = [[UIImageView alloc]init];
    self.icon = icon;
    icon.image = [UIImage imageNamed:@"medtronic_phone.jpg"];
    CGSize imgSize = CGSizeMake(30, 30);
    UILabel *label = [[UILabel alloc]init];
    self.label = label;

    label.text = @"意见反馈";
    label.textColor = [UIColor XHH_colorWithHex:0x9D9D9D];
    UIImageView *arrow = [[UIImageView alloc]init];
    self.arrow = arrow;
    arrow.image = [UIImage imageNamed:@"pic_cell_green_accessory_img.jpg"];
    
    [self addSubview:icon];
    [self addSubview:label];
    [self addSubview:arrow];
    
    //自动布局
    [icon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(imgSize);
        make.centerY.mas_equalTo(self);
        make.left.mas_equalTo(self).offset(8);
    }];
    
    [label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.mas_equalTo(self.contentView);
        make.left.mas_equalTo(icon.mas_right).offset(10);
    }];
    
    [arrow mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.contentView);
        make.right.mas_equalTo(self.contentView).offset(-10);
    }];
    
}
@end



















